package pl.edu.pk.cc.client.connections;

import java.util.List;
import java.util.Vector;

import pl.edu.pk.cc.common.dto.CCAgreementDTO;
import pl.edu.pk.cc.common.dto.CCCallHistoryDTO;
import pl.edu.pk.cc.common.dto.CCClientDTO;
import pl.edu.pk.cc.common.dto.CCEmploymentDTO;
import pl.edu.pk.cc.common.dto.CCProjectsDTO;
import pl.edu.pk.cc.common.dto.CCResourceDTO;
import pl.edu.pk.cc.common.dto.CCSaleDTO;
import pl.edu.pk.cc.common.dto.CCWorkerDTO;

public class CCSimpleServerCaller {

	private CCSimpleServerCaller() {
	}

	public static void logout() {
		CCServerCallsExecutor.logout();
	}

	public static boolean login(String login, String password, String url) {
		return CCServerCallsExecutor.login(login, password, url);
	}

	/**
	 * public static List<CCResourceDTO> getClientsByIDs(Vector<Object> IDs) { return CCServerCallsExecutor.getResourceByID("Clients", IDs); }
	 * 
	 * public static List<CCResourceDTO> getClientsByNames(Vector<Object> names) { return CCServerCallsExecutor.getResourceByString("Clients","name", names); }
	 */

	public static Vector<CCAgreementDTO> getAgreementByID(Vector<Long> params) {
		return CCServerCallsExecutor.getAgreementByID(params);
	}

	public static Vector<CCAgreementDTO> getAgreementByClientID(Vector<Long> params) {
		return CCServerCallsExecutor.getAgreementByClientID(params);
	}

	public static Vector<CCCallHistoryDTO> getCallHistoryByID(Vector<Long> params) {
		return CCServerCallsExecutor.getCallHistoryByID(params);
	}

	public static Vector<CCCallHistoryDTO> getCallHistoryByClientID(Vector<Long> params) {
		return CCServerCallsExecutor.getCallHistoryByClientID(params);
	}

	public static Vector<CCCallHistoryDTO> getCallHistoryByWorkerID(Vector<Long> params) {
		return CCServerCallsExecutor.getCallHistoryByWorkerID(params);
	}

	public static Vector<CCClientDTO> getClientByID(Vector<Long> params) {
		return CCServerCallsExecutor.getClientByID(params);
	}

	public static Vector<CCClientDTO> getClientByName(Vector<String> params) {
		return CCServerCallsExecutor.getClientByName(params);
	}

	public static Vector<CCClientDTO> getClientByAddress(Vector<String> params) {
		return CCServerCallsExecutor.getClientByAddress(params);
	}

	public static Vector<CCEmploymentDTO> getEmploymentByID(Vector<Long> params) {
		return CCServerCallsExecutor.getEmploymentByID(params);
	}

	public static Vector<CCEmploymentDTO> getEmploymentByPlacement(Vector<String> params) {
		return CCServerCallsExecutor.getEmploymentByPlacement(params);
	}

	public static Vector<CCEmploymentDTO> getEmploymentByWorkerID(Vector<Long> params) {
		return CCServerCallsExecutor.getEmploymentByWorkerID(params);
	}

	public static Vector<CCSaleDTO> getSaleByID(Vector<Long> params) {
		return CCServerCallsExecutor.getSaleByID(params);
	}

	public static Vector<CCSaleDTO> getSaleByClientID(Vector<Long> params) {
		return CCServerCallsExecutor.getSaleByClientID(params);
	}

	public static Vector<CCWorkerDTO> getWorkerByID(Vector<Long> params) {
		return CCServerCallsExecutor.getWorkerByID(params);
	}

	public static Vector<CCWorkerDTO> getWorkerByName(Vector<String> params) {
		return CCServerCallsExecutor.getWorkerByName(params);
	}

	public static Vector<CCWorkerDTO> getWorkerByLogin(Vector<String> params) {
		return CCServerCallsExecutor.getWorkerByLogin(params);
	}

	/**
	 * @param params
	 *            - use only one type of resource in one execution - mix will cause problems on server
	 */
	public static void saveToServer(Vector<CCResourceDTO> params) {
		CCServerCallsExecutor.saveData(params);
	}

	public static Vector<CCClientDTO> getClientByWorkerID(Vector<Long> params) {
		return CCServerCallsExecutor.getClientByWorkerID(params);
	}

	public static List<CCAgreementDTO> getAgreementAll() {
		return CCServerCallsExecutor.getAgreementAll();
	}

	public static List<CCProjectsDTO> getProjectsAll() {
		return CCServerCallsExecutor.getProjectsAll();
	}

	public static List<CCClientDTO> getClientsRand() {
		return CCServerCallsExecutor.getClientsRand();
	}

	public static List<String> getScriptByType(String type) {
		return CCServerCallsExecutor.getScriptByType(type);
	}
}
